package com.jt.www.enums.issue;

/**
 * ifCode对应的dex电子保单接口，以及返回值使用的方法
 */

public enum PolicyInterfaceEnum {
    CODE_1("20190528001", "20190516022", "泰然无忧百万医疗"),
    CODE_2("20190528002", "20190516022", "华泰财险成长护航重疾险"),
    CODE_3("20190528003", "20190516022", "华泰财险安康保护伞"),
    CODE_4("20190516002", "20190516022", "山东省校（园）方责任保险项"),
    CODE_5("20200312002", "20200312004", "云南学平险"),
    CODE_6("20190516006", "20190516016", "校方综合防范保障保险"),
    CODE_7("20190516006", "20190516016", "教职员工校方责任保险"),
    CODE_70("20190516006", "20190516016", "云南省校方责任保险"),
    CODE_9("20190516006", "20190516016", "校园食品安全责任保险"),
    CODE_10("20190515002", "20190515012", "实责（全国职业院校学生实习责任保险）"),
    CODE_11("20190726012", "20190726003", "校责（校方责任保险"),
    CODE_12("20190805002", "20190805003", "食品险阳光"),
    CODE_13("20190515026", "20190515003", "学责（学生安全责任保险"),
    CODE_14("20190515006", "20190515016", "阳光财产安责保护伞"),
    CODE_15("20200211001", "20200212012", "阳光财产安责保护伞"),
    CODE_16("20200330006", "20200330012", "阳光财产安责保护伞"),
    CODE_17("20190802002", "20190802022", "校园食品安全责任保险"),
    CODE_18("20190729001", "20190729002,20190729003", "徐州学平险（徐州学平意外险/徐州监护人责任险）"),
    CODE_19("20190805001", "20190516022", "济宁学平险"),
    CODE_20("20190807001", "20190516022", "校园食品"),
    CODE_21("20190518001", "20190518021", "实责校责（大地）"),
    CODE_22("20190726017", "20190726008", "实责校责（太平）"),
    CODE_23("20190731001", "20190726008", "实责校责（中华联合）"),
    CODE_24("20190827001", "20191118001", "新国寿财"),
    CODE_25("20190802001", "20190802032", "食品险国寿财"),
    CODE_26("20190909101", "20190802032", "食品险（太平）"),
    CODE_27("20190919002", "20190516022", "山东人保出单"),
    CODE_28("202006171149460", "202006171156520", "我学保监护人责任险出单");


    private String ifCode;
    private String dexPolicyCode;
    private String desc;

    PolicyInterfaceEnum(String ifCode, String dexPolicyCode, String desc) {
        this.ifCode = ifCode;
        this.dexPolicyCode = dexPolicyCode;
        this.desc = desc;
    }

    /**
     * 根据ifCode获取对应dex保单接口
     *
     * @param ifCode
     * @return
     */
    public static String getDexPolicyInterfaceByIfCode(String ifCode) {
        for (PolicyInterfaceEnum issueEnum : PolicyInterfaceEnum.values()) {
            if (issueEnum.ifCode.equals(ifCode)) {
                return issueEnum.dexPolicyCode;
            }
        }
        return "";
    }

    /**
     * 根据ifCode获取对应产品编码名称
     *
     * @param ifCode
     * @return
     */
    public static String getProNameByIfCode(String ifCode) {
        for (PolicyInterfaceEnum issueEnum : PolicyInterfaceEnum.values()) {
            if (issueEnum.ifCode.equals(ifCode)) {
                return issueEnum.desc;
            }
        }
        return "";
    }

    /**
     * 通过ifCode获取对应枚举值
     *
     * @param ifCode
     * @return
     */
    public static PolicyInterfaceEnum getIssueEnum(String ifCode) {
        for (PolicyInterfaceEnum issueEnum : PolicyInterfaceEnum.values()) {
            if (issueEnum.ifCode.equals(ifCode)) {
                return issueEnum;
            }
        }
        return null;
    }

    public String getIfCode() {
        return ifCode;
    }

    public String getDexPolicyCode() {
        return dexPolicyCode;
    }

    public String getDesc() {
        return desc;
    }

}
